//
//  TeHui.m
//  SeeTheWorld
//
//  Created by dllo on 16/1/29.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TeHui.h"
#import "PCH.pch"
#import <UIImageView+WebCache.h>


@interface TeHui ()

@property (nonatomic, retain)UIButton *buttonOfLeft;
@property (nonatomic, retain)UIImageView *imageViewTanHao;
@property (nonatomic, retain)UILabel *label;
@property (nonatomic, retain)UIButton *buttonOfYuYue;

@end

@implementation TeHui

- (void)dealloc {
    [_imageViewTanHao release];
    [_label release];
    [_buttonOfYuYue release];
    [_buttonOfLeft release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"特惠";
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:19], NSFontAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName,nil];
    self.navigationController.navigationBar.dk_barTintColorPicker = DKColorWithColors([UIColor colorWithRed:43 / 256.f green:115 / 256.f blue:217 / 256.f alpha:1], [UIColor colorWithRed:39 / 256.f green:39 / 256.f blue:39 / 256.f alpha:1]);
    
    self.buttonOfLeft = [UIButton buttonWithType:UIButtonTypeCustom];
    self.buttonOfLeft.frame = CGRectMake(5, 10, 30, 30);
    [self.buttonOfLeft addTarget:self action:@selector(fanHui:) forControlEvents:UIControlEventTouchUpInside];
    [self.buttonOfLeft setBackgroundImage:[UIImage imageNamed:@"iconfont-fanhui-2"] forState:UIControlStateNormal];
    UIBarButtonItem *bar = [[UIBarButtonItem alloc] initWithCustomView:self.buttonOfLeft];
    self.navigationItem.leftBarButtonItem = bar;
    [bar release];
    
    self.imageViewTanHao = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"GanTanHao"]];
    self.imageViewTanHao.frame = CGRectMake(100, HEIGHT / 3 + 40, 40, 40);
    [self.view addSubview:self.imageViewTanHao];
    [_imageViewTanHao release];
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(145, HEIGHT / 3 + 40, WIDTH - 120, 40)];
    [self.view addSubview:self.label];
    [_label release];
    self.label.text = @"无定制特惠";
    self.label.font = [UIFont systemFontOfSize:20];
    self.label.dk_textColorPicker = DKColorWithRGB(0x343434, 0xffffff);

    self.buttonOfYuYue = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:self.buttonOfYuYue];
    self.buttonOfYuYue.frame = CGRectMake(100, HEIGHT / 3 + 40 + 44, WIDTH / 3 + 40, 40);
    self.buttonOfYuYue.backgroundColor = [UIColor redColor];
    [self.buttonOfYuYue setTitle:@"我要定制" forState:UIControlStateNormal];
    [self.buttonOfYuYue addTarget:self action:@selector(dingZhi:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)dingZhi:(UIButton *)button {
    
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"该功能暂未开放" preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *action = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
        
    }];
    [alert addAction:action];
    
    [self presentViewController:alert animated:YES completion:^{
        
        
    }];
}














- (void)fanHui:(UIButton *)button {

    [self.navigationController popViewControllerAnimated:YES];
}











- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
